#!/usr/bin/env python3.11
# -*- encoding: utf-8 -*-
'''
@File    :   schema.py
@Time    :   2024/04/15 15:05:35
@Author  :   windstarry 
@Version :   1.0
'''
# here put the import lib
from ninja_schema import ModelSchema,Schema
from ninja import Field
from .models import File as FileModel

class FileSchema(Schema):
    name: str = Field(None, alias="name")
    url: str = Field(None, alias="url")

class FileSchemaOut(ModelSchema):
    class Config:
        model = FileModel
        model_fields = ['id','name','save_name', 'url', 'size']